<?php
/**
 * 功能: 邀请赚钱
 * User: WD
 * Date: 2018/8/24 0024
 * Time: 9:40
 */

namespace app\index\controller;
use think\Controller;
use think\Db;

class Invite extends Controller{
    /**
     * 邀请赚钱页面
     */
    public function index(){
        $invite = Db::name('invite')->select();
        $arr    = [];
        if($invite){
            foreach($invite as $k=>$v){
                $arr[$k] = $v;
                $arr[$k]['image'] = array_filter(explode(',',$v['image']));
            }
        }
        if($invite){
            return json(['msg'=>'请求成功','ok'=>true,'data'=>$arr]);
        }else{
            return json(['msg'=>'暂无数据','ok'=>false]);
        }
    }

}